require 'mathn'
sum=0
array=(1..2000000)
array.each do |x|
	if x.prime?
		sum+=x
	end
end

puts sum